<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: Circle.php
 * Date: 2017/1/2
 * Time: 21:45
 */

namespace app\api\controller;

use app\api\model\page\circle\AddCircle as AddCircleModel;
use app\api\model\page\circle\ApproveCircle as ApproveCircleModel;
use app\api\model\page\circle\GetCircle as GetCircleModel;

use think\Request;

class Circle {
    
    private $addCircleModel;
    private $approveCircleModel;
    private $getCircleModel;
    
    protected $param;

    public function __construct() 
    {
        $this->param = Request::instance()->param();
        
        $this->addCircleModel     = new AddCircleModel();
        $this->approveCircleModel = new ApproveCircleModel();
        $this->getCircleModel     = new GetCircleModel();
    }

    /**
     * 新建圈子审核
     *
     * @return array
     */
    public function addCircle()
    {
        return $this->addCircleModel->excute($this->param);
    }

    /**
     * 审核圈子
     * status：1：通过，2：驳回
     * 
     * @return array
     */
    public function approveCircle()
    {
        return $this->approveCircleModel->excute($this->param);
    }

    /**
     * 
     * 获取所有圈子
     * 
     * @return array
     */
    public function getCircle()
    {
        return $this->getCircleModel->excute($this->param);
    }
}
